package com.zzyl.mapper.customer;


import com.github.pagehelper.Page;
import com.zzyl.entity.Visit;
import com.zzyl.vo.TimeCountVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Description ReservationMapper
 * @Author liangDong
 * @Date 2025-05-16  12:11
 */
@Mapper
public interface ReservationMapper {


    @Insert("insert into reservation (name, mobile, time, visitor, type, status, create_time, create_by) " +
            "values (#{name},#{mobile},#{time},#{visitor},#{type},#{status},#{createTime},#{createBy})")
    void insert(Visit visit);
    //@Select("select r.* ,m.name as creator from reservation r left join member m on r.create_by = m.id")
    Page<Visit> selelctAll(int status, Long userId);

    @Update("update reservation set status = #{status} where id = #{id}")
    void cancel(Long id, Integer status);

    List<TimeCountVo> getCountList(String formattedTime, Long id);
}
